<#include "/common/layout.html">
<@header>
</@header>
<@body>
<#list pageData.getRecords() as it>
<article class="format-standard type-post hentry clearfix">
	<header class="clearfix">
		<h3 class="post-title">
			<!-- <img alt="" src="${(it.icon)!''}" style="width: 30px;" class="img-circle"> -->
			<#if it.source=='码云'>
				<img src="/images/osc.png" style="width: 18px;" title="码云" />
			<#elseif  it.source=='GitHub'>
				<i class="fa fa-github" title="GitHub"></i> 
			<#else>
				<i class="fa fa-code"></i> 
			</#if>
			<a href="/d?id=${it.id}" target="_blank">${it.prjName?split('/')[1]}</a> <span
				class="label label-success">${it.lang}</span>
			<#if it.star gt 500 >
				<i class="fa fa-thumbs-o-up" style="color:#ff7429;" title="推荐"></i>
			</#if>
		</h3>
		<div class="post-meta clearfix">
			<span class="date">${it.lastUpdateTimeFmt!''}</span>
			 <#list it.tags?split(",") as tag> <span class="category"><a href="/s?tag=${tag}">${tag}</a></span>
			</#list>
			<span class="like-count">
              	<!--  <i class="fa fa-git"></i> 
                <i class="fa fa-github"></i>  
                <i class="fa fa-thumbs-o-up"></i> -->
                <i class="fa fa-star"></i> ${it.starFmt}
            </span>
		</div>
		<!-- end of post meta -->
	</header>
	<p>${it.prjDesc}</p>
</article>

</#list>
<div id="pagination">
  <!--  <a href="#" class="btn active">1</a>
   <a href="#" class="btn">2</a>
   <a href="#" class="btn">3</a>
   <a href="#" class="btn">下一页 »</a>
   <a href="#" class="btn">末页 »</a> -->
</div>
 </@body> 
 <@footer>
 <script type="text/javascript" src="/js/jquery.pagination.js"></script>
 <script type="text/javascript">
	$(function(){
		var initPagination = function() {
			// 创建分页
			$("#pagination").pagination(${pageData.total!0}, {
				num_edge_entries: 1, 
				num_display_entries: 8, 
				callback: pageselectCallback,
				current_page:${pageData.current-1},
				items_per_page:${pageData.size!20}
			});
		 }();
		 
		function pageselectCallback(page_index, jq){
			var c_page = parseInt(page_index) + 1;
			if(c_page!=parseInt(${pageData.current})){
				window.location.href="/s?q=${q!''}&tag=${tag!''}&s=${pageData.size!20}&p="+c_page;
			}
			console.log(page_index);
			console.log(jq);
			return false;
		}
	});
</script>
 </@footer>
